// 创建一个固定长度为N的数组类型
export type FixedLengthArray<T, N extends number> = N extends N
    ? number extends N
    ? T[]
    : TupleOf<T, N, []>
    : never;

type TupleOf<T, N extends number, R extends unknown[]> = R["length"] extends N
    ? R
    : TupleOf<T, N, [T, ...R]>;
